Story - 2 : Can the FED Control Inflation and Maintain Full EmploymentΒΆ

InstructionsΒΆ

The Federal Reserve's mandate from Congress is to control inflation and to maintain low unemployment. These seem to be contradictory objectives. For this story you will need to source the following data for the last 25 years;

  • The Consumer Price Index (CPI) (Bureau of Labor Statistics)
  • The FED Funds Rate (FRED) (Federal Reserve Board)
  • Unemployment Rate (Bureau of Labor Statistics)

Your Data Visualizations should be designed to answer the question "Has the FED been able to fulfill the mandate given to it by Congress?"

Notes:

  • You must use a different application or library to create your visualization(s) from what you used for Story -1 (e.g. If you used Excel for Story -1 you may not use it for this story)
  • You will receive 20 bonus point if you access the data through available APIs using code that you develop
  • Remember, the FED raises rate after reviewing the CPI and other data and unemployment (layoffs) occur after company operating costs go up.
  • This assignment is due at the end of week four of the semester

Story 2 Notes:ΒΆ

  • For Story 1, I made use of matplotlib, for this one i will use plotly as per the requirement of leveraging a different tool/ application. If this isnt sufficient please let me know and i can do in R.
  • Leveraging the APIs for pulling in data for bonus points.

Fed Reserve DataΒΆ

BLS DataΒΆ

Needs two pulls for each data setbecause limits on API, the first pull stops at 2019. need to do second pull for each from 2020 throuh 2025ΒΆ
2018-12-01  is max date
need second pull. Starting that now.
date is recent
2018-12-01  is max date
need second pull. Starting that now.
date is recent

Puting into one working dfΒΆ

Begining of Visualization work.ΒΆ

C:\Users\johnf\AppData\Local\Temp\ipykernel_31300\3062125501.py:2: SettingWithCopyWarning:


A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

C:\Users\johnf\AppData\Local\Temp\ipykernel_31300\3062125501.py:3: FutureWarning:

ChainedAssignmentError: behaviour will change in pandas 3.0!
You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
A typical example is when you are setting values in a column of a DataFrame, like:

df["col"][row_indexer] = value

Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`.

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy


C:\Users\johnf\AppData\Local\Temp\ipykernel_31300\3062125501.py:3: SettingWithCopyWarning:


A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

C:\Users\johnf\AppData\Local\Temp\ipykernel_31300\3062125501.py:3: SettingWithCopyWarning:


A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

C:\Users\johnf\AppData\Local\Temp\ipykernel_31300\65764746.py:13: FutureWarning:

ChainedAssignmentError: behaviour will change in pandas 3.0!
You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
A typical example is when you are setting values in a column of a DataFrame, like:

df["col"][row_indexer] = value

Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`.

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy


C:\Users\johnf\AppData\Local\Temp\ipykernel_31300\65764746.py:13: SettingWithCopyWarning:


A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

C:\Users\johnf\AppData\Local\Temp\ipykernel_31300\65764746.py:13: FutureWarning:

Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'Closer to 2% Goal' has dtype incompatible with bool, please explicitly cast to a compatible dtype first.

Overall, based on the rough 60% success rate that the Federal Reserve has for the dual mandate - to keep inflation in check, and unemployment low - one can conclude that the Federal Reserve is satisfactorily meeting its mandate.ΒΆ